<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <script src="https://cdn.jsdelivr.net/npm/lodash@4.17.15/lodash.js"></script>
</head>
<body>

</body>
<script>

  var arr = [
    { activity: '工作', time: 480 },
    { activity: '吃早饭', time: 20 },
    { activity: '吃午饭', time: 20 },
    { activity: '吃晚饭', time: 20 },
    { activity: '行走', time: 40 },
    { activity: '学习', time: 60 },
    { activity: '打游戏', time: 60 },
    { activity: '约会', time: 60 },
    { activity: '运动', time: 60 },
    { activity: '思考', time: 30 }
  ]
  var sortResult = _.orderBy(arr,['time'],['desc'])
  console.log(sortResult)
  var sortResult = _.orderBy(arr,function(item) {
    return item.time
  },['desc'])
  console.log(sortResult)



</script>
</html>